package com.attendance.www.hr.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.attendance.www.hr.dao.mapper.MainUsersMapper;
import com.attendance.www.hr.entitys.MainUsers;
import com.attendance.www.hr.entitys.MainUsersExample;
import com.attendance.www.hr.service.IMainUsersService;

@Service
public class MainUsersServiceImpl implements IMainUsersService{
	@Resource
	private MainUsersMapper mainUsersDao;
	
	/**
	 * 查询人员主数据表
	 */
	@Override
	public List<MainUsers> getMainUsersList() {
		List<MainUsers> mainUsersList = mainUsersDao.selectByExample(new MainUsersExample());
		return mainUsersList;
	}

	/**
	 * 增加人员主数据表
	 */
	@Override
	public void saveMainUsers(List<MainUsers> mainUsersList) {
		for (int i = 0; i < mainUsersList.size(); i++) {
			mainUsersDao.insertSelective(mainUsersList.get(i));
		}
	}

	/**
	 * 删除人员主数据表
	 */
	@Override
	public boolean deleteMainUsers() {
		if(mainUsersDao.deleteByExample(new MainUsersExample())>0) {
			return true;
		}
		return false;
	}
	
}
